import request from '@/utils/request'

// 获取广告位及对应的广告
export const getAllAds = params => {
  return request({
    url: '/front/ad/getAllAds',
    method: 'GET',
    params
  })
}

// 分页查询课程
export const getQueryCourses = data => {
  return request({
    url: '/front/course/getQueryCourses',
    method: 'POST',
    data
  })
}

// 已购课程接口
export const getPurchaseCourse = () => {
  return request({
    url: '/front/course/getPurchaseCourse',
    method: 'GET'
  })
}

// 课程详情
export const getCourseById = courseId => {
  return request({
    url: '/front/course/getCourseById',
    method: 'GET',
    params: {
      courseId
    }
  })
}

// 获取课程章节
export const getSectionAndLesson = courseId => {
  return request({
    url: '/front/course/session/getSectionAndLesson',
    method: 'GET',
    params: {
      courseId
    }
  })
}

// 阿里云获取对应播放课程
export const videoPlayInfo = lessonId => {
  return request({
    url: '/front/course/media/videoPlayInfo',
    method: 'GET',
    params: {
      lessonId
    }
  })
}
